package com.gavin.demo4fresco.app;

import android.app.Application;
import android.graphics.Bitmap;

import com.facebook.drawee.backends.pipeline.Fresco;
import com.facebook.imagepipeline.core.ImagePipelineConfig;
import com.facebook.imagepipeline.decoder.SimpleProgressiveJpegConfig;

/**
 * Created by Gavin on 16/2/10.
 */
public class Demo4FrescoApplication extends Application{
    @Override
    public void onCreate() {
        super.onCreate();
        /**
         * 实现渐进式图,需要下面的配置,然后还需要在请求网络图片时,显示允许渐进式图片加载(支持 JPEG 格式)
         * 具体见 demo
         */
        ImagePipelineConfig config = ImagePipelineConfig.newBuilder(this)
                .setProgressiveJpegConfig(new SimpleProgressiveJpegConfig())
                .setBitmapsConfig(Bitmap.Config.ARGB_8888)
                .build();
        Fresco.initialize(this,config);
    }
}
